import Vue from "vue";
import Element from "element-ui";
import "@/styles/index.scss"; // global css
import App from "./App";
import store from "./store";
import router from "./router";
import "./icons"; // icon
import "./icons/myIcon/iconfont.css";
import "./filters"; // global filters
import "./components";
import "@/utils/notification";
import "@/utils/autoUpdate";
import "./utils/drag";
// import "./utils/importJs";
// import "./utils/flexible";
import vueFlvPlayer from "vue-flv-player";
import { rootPath } from "./configurations";
import formCreate from "@/formComponents";
let api = require("./api/index"); //将请求方式挂载全局
Vue.prototype.$Api = api;
// import FcDesigner from "@form-create/designer";
// Vue.use(FcDesigner);
// import ZkTable from "vue-table-with-tree-grid";

// Vue.use(ZkTable);
// Vue.config.warnHandler = function (msg, vm, trace) {
//   console.log(msg, vm, trace);
//   window.location.reload();
// };
import "@/plugins/vant";
Vue.use(vueFlvPlayer);
Vue.use(Element);
Vue.use(formCreate);
Vue.prototype.$resolvePath = url => {
  return `${rootPath}${url}`;
};
Vue.prototype.$optional = (obj, ...rest) => {
  let key = "";
  while ((key = rest.shift())) {
    if (!obj) break;
    obj = obj[key];
  }
  return obj;
};
Vue.config.productionTip = false;
new Vue({
  el: "#app",
  router,
  store,
  render: h => h(App)
});

// 线上环境影藏打印
// if (process.env.NODE_ENV !== "development") {
//   console.log = function() {};
//   console.error = function() {};
// }
